package ceha;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "fiche")
@NamedQueries({
    @NamedQuery(name = "Fiche.findAll", query = "SELECT f FROM Fiche f"),
    @NamedQuery(name = "Fiche.findById", query = "SELECT f FROM Fiche f WHERE f.id = :id"),
    @NamedQuery(name = "Fiche.findByImagefilename", query = "SELECT f FROM Fiche f WHERE f.imagefilename = :imagefilename"),
    @NamedQuery(name = "Fiche.findBySource", query = "SELECT f FROM Fiche f WHERE f.source = :source"),
    @NamedQuery(name = "Fiche.findByDate", query = "SELECT f FROM Fiche f WHERE f.date = :date"),
    @NamedQuery(name = "Fiche.findByDatetexte", query = "SELECT f FROM Fiche f WHERE f.datetexte = :datetexte"),
    @NamedQuery(name = "Fiche.findByLienimage", query = "SELECT f FROM Fiche f WHERE f.lienimage = :lienimage"),
    @NamedQuery(name = "Fiche.findByLienfichier", query = "SELECT f FROM Fiche f WHERE f.lienfichier = :lienfichier"),
    @NamedQuery(name = "Fiche.findByTypedocument", query = "SELECT f FROM Fiche f WHERE f.typedocument = :typedocument"),
    @NamedQuery(name = "Fiche.findByFond", query = "SELECT f FROM Fiche f WHERE f.fond = :fond"),
    @NamedQuery(name = "Fiche.findByDatedonation", query = "SELECT f FROM Fiche f WHERE f.datedonation = :datedonation"),
    @NamedQuery(name = "Fiche.findByDroitsrepro", query = "SELECT f FROM Fiche f WHERE f.droitsrepro = :droitsrepro"),
    @NamedQuery(name = "Fiche.findByDimension", query = "SELECT f FROM Fiche f WHERE f.dimension = :dimension"),
    @NamedQuery(name = "Fiche.findByDatecorrection", query = "SELECT f FROM Fiche f WHERE f.datecorrection = :datecorrection"),
    @NamedQuery(name = "Fiche.findByIdcorrecteur", query = "SELECT f FROM Fiche f WHERE f.idcorrecteur = :idcorrecteur"),
    @NamedQuery(name = "Fiche.findByValide", query = "SELECT f FROM Fiche f WHERE f.valide = :valide")})
public class Fiche implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "imagefilename")
    private String imagefilename;
    @Column(name = "source")
    private String source;
    @Basic(optional = false)
    @Lob
    @Column(name = "titre")
    private String titre;
    @Lob
    @Column(name = "auteur")
    private String auteur;
    @Column(name = "date")
    @Temporal(TemporalType.DATE)
    private Date date;
    @Column(name = "datetexte")
    private String datetexte;
    @Lob
    @Column(name = "resume")
    private String resume;
    @Column(name = "lienimage")
    private String lienimage;
    @Column(name = "lienfichier")
    private String lienfichier;
    @Column(name = "typedocument")
    private String typedocument;
    @Column(name = "fond")
    private String fond;
    @Column(name = "datedonation")
    @Temporal(TemporalType.DATE)
    private Date datedonation;
    @Column(name = "droitsrepro")
    private String droitsrepro;
    @Lob
    @Column(name = "localisation")
    private String localisation;
    @Column(name = "dimension")
    private String dimension;
    @Column(name = "datecorrection")
    @Temporal(TemporalType.DATE)
    private Date datecorrection;
    @Column(name = "idcorrecteur")
    private Integer idcorrecteur;
    @Column(name = "valide")
    private Boolean valide;

    public Fiche() {
    }

    public Fiche(Integer id) {
        this.id = id;
    }

    public Fiche(Integer id, String titre) {
        this.id = id;
        this.titre = titre;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getImagefilename() {
        return imagefilename;
    }

    public void setImagefilename(String imagefilename) {
        this.imagefilename = imagefilename;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getTitre() {
        return titre;
    }

    public void setTitre(String titre) {
        this.titre = titre;
    }

    public String getAuteur() {
        return auteur;
    }

    public void setAuteur(String auteur) {
        this.auteur = auteur;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getDatetexte() {
        return datetexte;
    }

    public void setDatetexte(String datetexte) {
        this.datetexte = datetexte;
    }

    public String getResume() {
        return resume;
    }

    public void setResume(String resume) {
        this.resume = resume;
    }

    public String getLienimage() {
        return lienimage;
    }

    public void setLienimage(String lienimage) {
        this.lienimage = lienimage;
    }

    public String getLienfichier() {
        return lienfichier;
    }

    public void setLienfichier(String lienfichier) {
        this.lienfichier = lienfichier;
    }

    public String getTypedocument() {
        return typedocument;
    }

    public void setTypedocument(String typedocument) {
        this.typedocument = typedocument;
    }

    public String getFond() {
        return fond;
    }

    public void setFond(String fond) {
        this.fond = fond;
    }

    public Date getDatedonation() {
        return datedonation;
    }

    public void setDatedonation(Date datedonation) {
        this.datedonation = datedonation;
    }

    public String getDroitsrepro() {
        return droitsrepro;
    }

    public void setDroitsrepro(String droitsrepro) {
        this.droitsrepro = droitsrepro;
    }

    public String getLocalisation() {
        return localisation;
    }

    public void setLocalisation(String localisation) {
        this.localisation = localisation;
    }

    public String getDimension() {
        return dimension;
    }

    public void setDimension(String dimension) {
        this.dimension = dimension;
    }

    public Date getDatecorrection() {
        return datecorrection;
    }

    public void setDatecorrection(Date datecorrection) {
        this.datecorrection = datecorrection;
    }

    public Integer getIdcorrecteur() {
        return idcorrecteur;
    }

    public void setIdcorrecteur(Integer idcorrecteur) {
        this.idcorrecteur = idcorrecteur;
    }

    public Boolean getValide() {
        return valide;
    }

    public void setValide(Boolean valide) {
        this.valide = valide;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Fiche)) {
            return false;
        }
        Fiche other = (Fiche) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ceha.Fiche[id=" + id + "]";
    }
}
